package com.pig4cloud.pigx.contract.open.api.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.pig4cloud.pigx.common.customize.utils.serializer.BigDecimalToPlainStringSerializer;
import com.pig4cloud.pigx.contract.annotation.SetScaleMainCurrency;
import com.pig4cloud.pigx.contract.annotation.SetScaleTokenCurrency;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 */
@Data
public class OpenApiOrderVOV1 implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 币对名称
     */
    private String symbolName;

    /**
     * 下单时间
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long time;

    /**
     * 类型（0市价单、1限价单、2强平单）
     */
    @ApiModelProperty(value = "类型（0市价单、1限价单、2强平单）")
    private String type;

    /**
     * 仓位模式（0逐仓、1全仓）
     */
    @ApiModelProperty(value = "仓位模式（0逐仓、1全仓）")
    private String positionMode;

    /**
     * 方向（0做多、1做空）
     */
    @ApiModelProperty(value = "方向（0做多、1做空）")
    private String side;

    /**
     * 操作类型（0开仓、1平仓）
     */
    @ApiModelProperty(value = "操作类型（0开仓、1平仓）")
    private String operationType;

    /**
     * 价格
     */
    @SetScaleMainCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "价格")
    private BigDecimal price;

    /**
     * 数量
     */
    @SetScaleTokenCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "数量")
    private BigDecimal num;

    /**
     * 倍数
     */
    @ApiModelProperty(value = "倍数")
    private Integer multiple;

    /**
     * 成交金额
     */
    @SetScaleMainCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "成交金额")
    private BigDecimal dealAmount;

    /**
     * 已成交数量
     */
    @SetScaleMainCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "已成交数量")
    private BigDecimal dealNum;

    /**
     * 未成交金额
     */
    @SetScaleMainCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "未成交金额")
    private BigDecimal noDealAmount;

    /**
     * 未成交数量
     */
    @SetScaleTokenCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "未成交数量")
    private BigDecimal noDealNum;

    /**
     * 成交均价
     */
    @SetScaleMainCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "成交均价")
    private BigDecimal dealAvg;

    /**
     * 手续费
     */
    @SetScaleMainCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "手续费")
    private BigDecimal handlingFee;

    /**
     * 保证金
     */
    @SetScaleMainCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "保证金")
    private BigDecimal margin;

    /**
     * 收益，平仓时有值
     */
    @SetScaleMainCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "收益，平仓时有值")
    private BigDecimal profit;

    /**
     * 委托状态（0委托中、1部分成交、2部分已撤销、3完全成交、4已撤销、5已过期）
     */
    @ApiModelProperty(value = "委托状态（0委托中、1部分成交、2部分已撤销、3完全成交、4已撤销、5已过期）")
    private String status;

    /**
     * 强平清算费
     */
    @SetScaleMainCurrency
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    @ApiModelProperty(value = "强平清算费")
    private BigDecimal liquidateFee;

}
